$("#btn-search").click(function(){

			var search_query = $("#query").val();
			var api_url = "http://glosbe.com/gapi/translate?from=de&dest=eng&format=json&phrase=%QUERY%&pretty=true";
			api_url = api_url.replace("%QUERY%", search_query);
            //alert("Search for: " + api_url);
            $.ajax({
			    type: "GET",
			    url: "test_ajax.php",
			    async: true,
			    data: { 
			        'email': api_url
			    },
			 	error: function (xhr, ajaxOptions, thrownError) {
		        	console.log(xhr.responseText);
		      	},
			 	success: function(html){
			 		console.log(html);
			    	$('#banner').html('<div>'+html+'</div>');
			 	}
			});

        });

$(function(){
	$('#query').focus();

	$("#query").keyup(function(e){
		if(e.keyCode == 13)
		{
			$("#btn-search").click();
		}
	});
});
